Skip to content

feat: added support for NVMe disk controller for Azure VMs - #2071

Open
dharapvj wants to merge 1 commit into
kubermatic:mainfrom
dharapvj:azure-nvme-diskcontroller-support
Open

feat: added support for NVMe disk controller for Azure VMs#2071
dharapvj wants to merge 1 commit into
kubermatic:mainfrom
dharapvj:azure-nvme-diskcontroller-support

Conversation

@dharapvj

Copy link
Copy Markdown

What this PR does / why we need it:
With v6 series of VMs, Azure has remove SCSI disk controller support and it now only provides NVMe disks. If we try to use any v6 or v7 machines e.g. Standard_E2as_v7 we do not get new machines ready.

This PR adds support to specify NVMe as diskcontroller type which will fix the issue.

Which issue(s) this PR fixes:

Fixes #1980

What type of PR is this?

/kind feature
/kind chore

Special notes for your reviewer:
I do not know how to do a real world test on Azure. So hopefully, we have e2e tests which will get fired with this PR to get such testing done.

Does this PR introduce a user-facing change? Then add your Release Note here:

Azure VMs with series v6+ can be created via machine-controller

Documentation:

NONE

@kubermatic-bot kubermatic-bot added kind/feature Categorizes issue or PR as related to a new feature. docs/none Denotes a PR that doesn't need documentation (changes). release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/chore Updating grunt tasks etc; no production code changes. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. labels Aug 27, 2026
@kubermatic-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign buraksekili for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 27, 2026
for _, cap := range *sku.Capabilities {
if cap.Name != nil && *cap.Name == "DiskControllerTypes" && cap.Value != nil {
v := strings.ToLower(*cap.Value)
return v == "nvme" || (strings.Contains(v, "nvme") && !strings.Contains(v, "scsi"))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return v == "nvme" || (strings.Contains(v, "nvme") && !strings.Contains(v, "scsi"))
return strings.Contains(v, "nvme") && !strings.Contains(v, "scsi")

if string equals to "nvme" then strings.Contains(v, "nvme") is also true.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Azure VM disk controller selection support to unblock provisioning of v6+ Azure VM sizes that require NVMe controllers (per #1980), by allowing an explicit diskControllerType config and defaulting to NVMe for v6+ sizes when unspecified.

Changes:

  • Introduces diskControllerType in the Azure provider spec (SDK RawConfig) and wires it into provider configuration.
  • Sets StorageProfile.DiskControllerType during VM creation, defaulting to NVMe for v6+ VM sizes when not explicitly configured.
  • Adds validation and unit tests for NVMe-detection helpers and disk controller type validation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
sdk/cloudprovider/azure/types.go Adds diskControllerType to the Azure machine provider spec schema.
pkg/cloudprovider/provider/azure/provider.go Wires config + defaults DiskControllerType to NVMe for v6+; adds validation and SKU capability helpers.
pkg/cloudprovider/provider/azure/provider_test.go Adds unit tests for NVMe heuristics and disk controller validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +1043 to +1053
func validateDiskControllerType(_ context.Context, c *config, sku compute.ResourceSku) error {
if c.DiskControllerType != nil {
if !slices.Contains(compute.PossibleDiskControllerTypesValues(), *c.DiskControllerType) {
return fmt.Errorf("invalid diskControllerType %q, valid values are: %v", *c.DiskControllerType, compute.PossibleDiskControllerTypesValues())
}
if *c.DiskControllerType == compute.SCSI && skuRequiresNVMe(sku) {
return fmt.Errorf("VM size %q only supports NVMe disk controller, cannot use %q", c.VMSize, compute.SCSI)
}
}
return nil
}
Comment on lines +639 to +643
if config.DiskControllerType != nil {
sp.DiskControllerType = *config.DiskControllerType
} else if vmSizeRequiresNVMe(config.VMSize) {
sp.DiskControllerType = compute.NVMe
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/chore Updating grunt tasks etc; no production code changes. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure v6-series VMs fail to provision: missing DiskControllerType configuration for NVMe controllers

4 participants